import http from '@/utils/http/axios'
import { BasicPageParams, BasicResponseModel, BasicGetIdModel } from '@/api/model/baseModel'
import * as systemModel from '../../../ms-operator/src/api/model/systemModel'
import { ContentTypeEnum } from '@/enums/httpEnum'

/**
 * @description: 上传管理
 */
export function adgroupRecordInfo(params: any) {
  return http.request<BasicResponseModel>({
    url: '/api/adgroup/record/info',
    // url: 'https://yapi.madaomall.com/mock/207/adgroup/record/info',
    method: 'GET',
    params
  })
}
/**
 * @description: 上传管理明细
 */
export function adgroupRecordList(params: any) {
  return http.request<BasicResponseModel>({
    url: '/api/adgroup/record/list',
    // url: 'https://yapi.madaomall.com/mock/207/adgroup/record/list',
    method: 'GET',
    params
  })
}
/**
 * @description: 广告上传
 */
export function uploadAdgroup(params: { mediaId: string }) {
  return http.request<BasicResponseModel>({
    url: '/api/upload/adgroup-upload/excute',
    // url: 'https://yapi.madaomall.com/mock/207/upload/adgroup-upload/excute',
    method: 'POST',
    params
  })
}
/**
 * @description: 广告复制
 */
export function adgroupCopy(params: { mediaId: string }) {
  return http.request<BasicResponseModel>({
    url: '/api/adgroup/copy',
    method: 'POST',
    params
  })
}

/**
 * @description: 待上传广告列表
 */
export function getAdsManageList(params: any) {
  return http.request<BasicResponseModel<any>>({
    url: '/api/adgroup/list',
    // url: 'https://yapi.madaomall.com/mock/207/adgroup/list',
    method: 'GET',
    params
  })
}
/**
 * @description: 广告账户
 */
export function adgroupAccountCodeList(params: any) {
  return http.request<BasicResponseModel<any>>({
    url: '/api/adgroup/account/code/list',
    // url: 'https://yapi.madaomall.com/mock/207/adgroup/account/code/list',
    method: 'GET',
    params
  })
}
/**
 * @description: 删除广告
 */
export function adsManageRemove(params: any) {
  return http.request<BasicResponseModel>({
    url: '/api/adgroup/delete',
    // url: 'https://yapi.madaomall.com/mock/207/adgroup/delete',
    method: 'POST',
    params
  })
}
/**
 * @description: 广告素材复制广告
 */
export function adsManageCopy(params: any) {
  return http.request<BasicResponseModel>({
    url: '/api/adgroup/copy',
    // url: 'https://yapi.madaomall.com/mock/207/adgroup/copy',
    method: 'POST',
    params
  })
}
/**
 * @description: 批次删除广告
 */
export function adgroupBatchDelete(params: any) {
  return http.request<BasicResponseModel>({
    url: '/api/adgroup/batch/delete',
    // url: 'https://yapi.madaomall.com/mock/207/adgroup/batch/delete',
    method: 'POST',
    params
  })
}
/**
 * @description: 广告账户
 */
export function gdtAccountList(params: any) {
  return http.request<BasicResponseModel<any>>({
    url: '/api/gdt/account/list',
    method: 'GET',
    params
  })
}
/**
 * @description: 账户列表-导出
 */
export function accountExport(params: any) {
  return http.request<BasicResponseModel>({
    url: '/api/gdt/account/list/download',
    method: 'GET',
    params,
    responseType: 'arraybuffer'
  })
}
/**
 * @description: 账户列表搜索
 */
export function gdtAccountOwnerList(params: any) {
  return http.request<BasicResponseModel<any>>({
    url: '/api/gdt/account/owner/list',
    // url: 'https://yapi.madaomall.com/mock/207/gdt/account/owner/list',
    method: 'GET',
    params
  })
}
/**
 * @description: 广告列表
 */
export function gdtAdgroupsList(params: any) {
  return http.request<BasicResponseModel<any>>({
    url: '/api/gdt/account/adgroups/list',
    // url: 'https://yapi.madaomall.com/mock/207/gdt/account/adgroups/list',
    method: 'GET',
    params
  })
}
/**
 * @description: 广告详情
 */
export function gdtAdgroupsDetail(params: any) {
  return http.request<BasicResponseModel<any>>({
    url: '/api/gdt/account/adgroups/detail',
    // url: 'https://yapi.madaomall.com/mock/207/gdt/account/adgroups/detail',
    method: 'GET',
    params
  })
}
/**
 * @description: 广告列表_导出
 */
export function adgroupsExport(params: any) {
  return http.request<BasicResponseModel>({
    url: '/api/gdt/account/adgroups/download',
    method: 'GET',
    params,
    responseType: 'arraybuffer'
  })
}
/**
 * @description: 创意列表_导出
 */
export function creativesExport(params: any) {
  return http.request<BasicResponseModel>({
    url: '/api/gdt/account/creatives/download',
    method: 'GET',
    params,
    responseType: 'arraybuffer'
  })
}
/**
 * @description: 创意详情
 */
export function gdtMediaDetail(params: any) {
  return http.request<BasicResponseModel<any>>({
    url: '/api/gdt/account/creatives/detail',
    // url: 'https://yapi.madaomall.com/mock/207/gdt/account/creatives/detail',
    method: 'GET',
    params
  })
}
/**
 * @description: 修改广点通广告状态
 */
export function gdtAdgroupsBatchStatus(params: any) {
  return http.request<BasicResponseModel<any>>({
    url: '/api/adgroup/gdt/batch/status',
    // url: 'https://yapi.madaomall.com/mock/207/adgroup/gdt/batch/status',
    method: 'POST',
    params
  })
}
/**
 * @description: 修改广点通创意状态
 */
export function gdtCreativeBatchStatus(params: any) {
  return http.request<BasicResponseModel<any>>({
    url: '/api/adgroup/gdt/creative/batch/status',
    // url: 'https://yapi.madaomall.com/mock/207/adgroup/gdt/creative/batch/status',
    method: 'POST',
    params
  })
}
/**
 * @description: 广点通广告一键起量
 */
export function gdtBatchAcquisition(params: any) {
  return http.request<BasicResponseModel<any>>({
    url: '/api/adgroup/gdt/batch/acquisition',
    // url: 'https://yapi.madaomall.com/mock/207/adgroup/gdt/batch/acquisition',
    method: 'POST',
    params
  })
}
/**
 * @description: 修改广点通广告出价
 */
export function gdtBatchPrice(params: any) {
  return http.request<BasicResponseModel<any>>({
    url: '/api/adgroup/gdt/batch/price',
    // url: 'https://yapi.madaomall.com/mock/207/adgroup/gdt/batch/price',
    method: 'POST',
    params
  })
}
/**
 * @description: 修改广点通广告投放日期
 */
export function gdtBatchDate(params: any) {
  return http.request<BasicResponseModel<any>>({
    url: '/api/adgroup/gdt/batch/date',
    // url: 'https://yapi.madaomall.com/mock/207/adgroup/gdt/batch/date',
    method: 'POST',
    params
  })
}
/**
 * @description: 修改广点通广告投放时间
 */
export function gdtBatchTime(params: any) {
  return http.request<BasicResponseModel<any>>({
    url: '/api/adgroup/gdt/batch/time',
    // url: 'https://yapi.madaomall.com/mock/207/adgroup/gdt/batch/time',
    method: 'POST',
    params
  })
}
/**
 * @description: 批次删除广点通广告
 */
export function gdtBatchDelete(params: any) {
  return http.request<BasicResponseModel<any>>({
    url: '/api/adgroup/gdt/batch/delete',
    // url: 'https://yapi.madaomall.com/mock/207/adgroup/gdt/batch/delete',
    method: 'POST',
    params
  })
}
/**
 * @description: 批次删除广点通创意
 */
export function gdtCreativeBatchDelete(params: any) {
  return http.request<BasicResponseModel<any>>({
    url: '/api/adgroup/gdt/creative/batch/delete',
    method: 'POST',
    params
  })
}
/**
 * @description: 创意列表
 */
export function gdtCreativesList(params: any) {
  return http.request<BasicResponseModel<any>>({
    url: '/api/gdt/account/creatives/list',
    // url: 'https://yapi.madaomall.com/mock/207/gdt/account/creatives/list',
    method: 'GET',
    params
  })
}
/**
 * @description: 草稿箱
 */
export function adgroupBatchList(params: any) {
  return http.request<BasicResponseModel<any>>({
    url: '/api/adgroup/batch/list',
    // url: 'https://yapi.madaomall.com/mock/207/adgroup/batch/list',
    method: 'GET',
    params
  })
}

export function getAdsTemplateDetail(params: any) {
  return http.request<BasicResponseModel<any>>({
    // url: '/api/gdt/account/list',
    url: '/api/adgroup/creative/template/detail',
    method: 'GET',
    params
  })
}

export function getAdsTemplateList(params: any) {
  return http.request<BasicResponseModel<any>>({
    url: '/api/adgroup/creative/template/list',
    method: 'GET',
    params
  })
}
// 广告版位
export function getAdvSiteset(params: any) {
  return http.request<BasicResponseModel<any>>({
    // url: '/api/adgroup/batch/list',
    // url: '/api/gdt/account/list',
    url: '/api/adgroup/siteset/list',
    method: 'GET',
    params
  })
}

export function getAdvSceneSpecTags(params: any) {
  // https://yapi.madaomall.com/mock/207/adgroup/sceneSpecTags/get
  return http.request<BasicResponseModel<any>>({

    url: '/api/adgroup/sceneSpecTags/get',
    method: 'GET',
    params
  })
}
/**
 * @description: 商品库
 */
export function getCatalogsList(params: any) {
  return http.request<BasicResponseModel>({
    url: '/api/adgroup/product/catalogs/get',
    // url: 'https://yapi.madaomall.com/mock/207/adgroup/product/catalogs/get',
    method: 'GET',
    params
  })
}
/**
 * @description: 商品库-商品列表
 */
export function getCatalogsProductList(params: any) {
  return http.request<BasicResponseModel>({
    url: '/api/adgroup/product/items/get',
    // url: 'https://yapi.madaomall.com/mock/207/adgroup/product/items/get',
    method: 'GET',
    params
  })
}
/**
 * @description: 地理位置
 */
export function getTargetingTagsList(params: any) {
  return http.request<BasicResponseModel>({
    url: '/api/adgroup/targetingTags/list',
    // url: 'https://yapi.madaomall.com/mock/207/adgroup/targetingTags/list',
    method: 'POST',
    params
  })
}
/**
 * @description: 定向列表
 */
export function getTargetingList(params: any) {
  return http.request<BasicResponseModel>({
    url: '/api/adgroup/targeting/list',
    // url: 'https://yapi.madaomall.com/mock/207/adgroup/targetingTags/list',
    method: 'GET',
    params
  })
}

// 品牌列表
export function getAdBrandList(params: any) {
  return http.request<BasicResponseModel>({
    // url: '/api/adgroup/product/items/get',
    url: '/api/adgroup/brand/get',
    method: 'GET',
    params
  })
}

// 添加品牌
export function addAdBrand(params: any) {
  return http.request<BasicResponseModel>({
    // url: '/api/adgroup/product/items/get',
    url: '/api/adgroup/brand/upload',
    method: 'POST',
    params
  })
}

// 简介页列表

export function getProfileList(params: any) {
  return http.request<BasicResponseModel>({
    // url: '/api/adgroup/product/items/get',
    url: '/api/adgroup/profiles/get',
    method: 'get',
    params
  })
}

// /adgroup/creative/wechat/channel 视频号列表

export function getWechatChannel(params: any) {
  return http.request<BasicResponseModel>({
    // url: '/api/adgroup/product/items/get',
    url: '/api/adgroup/wechat/channel',
    method: 'get',
    params
  })
}

// 广告保存


export function saveAdv(params: any) {
  return http.request<BasicResponseModel>({
    // url: '/api/adgroup/product/items/get',
    url: '/api/adgroup/save',
    method: 'post',
    params
  })
}


// 原生推广页list
export function getCanvasPage(params: any) {
  return http.request<BasicResponseModel>({
    // url: '/api/adgroup/product/items/get',
    url: '/api/adgroup/creative/canvas/page',
    method: 'get',
    params
  })
}

// 广告详情
export function getAdvDetail(params: any) {
  return http.request<BasicResponseModel>({
    // url: '/api/adgroup/product/items/get',
    url: '/api/adgroup/info',
    method: 'get',
    params
  })
}

// 图片列表
export function getAdvImageList(params: any) {
  return http.request<BasicResponseModel>({
    // url: '/api/adgroup/product/items/get',
    url: '/api/adgroup/image/list',
    method: 'get',
    params
  })
}

// 图片上传
export function uploadImage(params: any) {
  return http.request<BasicResponseModel>({
    url: '/api/adgroup/image/upload',
    method: 'post',
    params,
    headers: {
      "Content-Type": "application/x-www-form-urlencoded"
    }
  })
}

// /media-account/mdmName/list

export function getMdmNameList(params: any) {
  return http.request<BasicResponseModel>({
    url: '/api/media-account/mdmName/list',
    method: 'get',
    params
  })
}

// dailyBudget

export function getImageList(params: any) {
  return http.request<BasicResponseModel>({
    url: '/api/adgroup/image/list',
    method: 'get',
    params
  })
}

export function getUploadedAdvList(params: any) {
  return http.request<BasicResponseModel>({
    url: '/api/adgroup/uploaded/list',
    method: 'post',
    params
  })
}
//

export function addProfile(params: any) {
  return http.request<BasicResponseModel>({
    url: '/api/adgroup/profiles/add',
    method: 'post',
    params,

  })
}

export function addCreative(params: any) {
  return http.request<BasicResponseModel>({
    url: '/api/adgroup/creative/save',
    method: 'post',
    params,

  })
}











